package cn.tedu.apiday04;


import java.io.Serializable;

// 1想要完成序列化，必须实现接口表示开启序列化功能
public class Student implements Serializable {



    //创建学生类。测试序列化
    //2 给每个文件提供唯一的id
    private static final long serialVersionUID = 4126809806779541577L;




    public Student(){}
    public Student(String name,int age){
        super();
        this.age = age;
        this.name = name;
    }
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
